package com.example.sqlite;

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity   {
   Button c1,c2,c3;
   Untils d;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        c1 = findViewById(R.id.b1);
        c2 = findViewById(R.id.b2);
        c3 = findViewById(R.id.b3);
        d = Untils.getInstance(getApplicationContext());
       c1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
     d.add();
            }
        });
       c2.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View v) {
               d.quer();
           }
       });
       c3.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View v) {
               d.del();
           }
       });
    }
    /*@Override
    public void onClick(View v)
    {

        switch (v.getId())
        {
            case R.id.b1:
                d.add();
                break;
            case R.id.b3:
                d.quer();
                break;

        }

    }*/

}
